<?php
require_once 'Ust/Model/Abstract.php';

class UserDAO extends Core_DAO
{
	protected $_name    = 'users';
	protected $_primary = 'user_id';
	
	
	public function addUser($data)
	{
		return $this->saveData($data);
	}
	
	/**
	 * This Method is used to get the user id as per Email.
	 * 
	 * @access public
	 * @param string $email
	 * @return int userId
	 */
	public function getUserIdByEmail($email)
	{
		$result = $this->select()
					   ->from($this->_name)
					   ->where('email = ?', $email)
					   ->query()
					   ->fetchAll();
		
		$return = (count($result) > 0) ? $result['account_id'] : '';
		
		return $return;
	}
	
}